package cn.tedu.storage.service;

import cn.tedu.storage.mapper.StorageMapper;
import cn.tedu.storage.tcc.StorageTccAction;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class StorageServiceImpl implements StorageService {
    @Autowired
    private StorageTccAction tccAction;

    @Override
    public void decrease(Long productId, Integer count) {
        //storageMapper.decrease(productId, count);

        //调用 TCC 第一阶段方法
        tccAction.prepareDecreaseStorage(null,productId,count);
    }
}
